<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" 
           uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'login.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	
	<script type="text/javascript" charset="utf-8" src="../js/base.js"></script>
	<script type="text/javascript">
	window.onload = function(){
		//changeDate();getTaskTime
		document.getElementById("changeDate").innerText=getTaskTime('${user.riqi}');
	}
	function changeDate(){
		var now ;
		now=new Date('${user.riqi}');
        var year = now.getFullYear();
        var month =(now.getMonth() + 1).toString();
        var day = (now.getDate()).toString();
        if (month.length == 1) {
            month = "0" + month;
        }
        if (day.length == 1) {
            day = "0" + day;
        }
        var dateTime = year + month +  day;
        document.getElementById("changeDate").innerText=dateTime;
	}
	 </script>
  </head>
  
  <body>
   用户: <br>
    <div>${user.name}</div><br>
    <div>${user.age}</div><br>
    <div><fmt:formatDate value="${user.riqi}" pattern="yyyy-MM-dd HH:mm:ss" /></div>
    <div id="changeDate"></div>
  </body>
</html>
